package com.powernode.dto;

import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

@Data
public class MessageDto {
    private String touser;
    private String templateId;
    private String url;
    private String topcolor;
    private Map<String, Map<String, String>> data;

    public static Map<String, String> setDataValue(String value, String color) {
        HashMap<String, String> map = new HashMap<>();
        map.put("value", value);
        map.put("color", StringUtils.hasText(color) ? color : "");
        return map;
    }
}
